package edu.ccut.saturn.basevalidate.prvalidate;

import edu.ccut.saturn.component.DefaultSaturnValidate;
import edu.ccut.saturn.component.ValidateResult;

public class IsIntegerValidate extends DefaultSaturnValidate {

	private static final String integerRegExpr = "^-?[1-9]\\d*$"; 

	public void doValidate(Object value, Object[] args, ValidateResult result) {
		if (!(value.toString()).matches(integerRegExpr)) {
			sendError(_ERROR_, value, result);
		}
	}
}
